<?php
if (power('s', $cid, $power, 4)) {
    if (power('s', $cid, $power, 5)) {
        $cidstrcount = M()->fetchcount("SELECT count(id) FROM " . tableex('str') . " where strcid='$cid';");
    } else {
        $cidstrcount = M()->fetchcount("SELECT count(id) FROM " . tableex('str') . " where strcid='$cid' and ifadmin='0';");
    }
    if ($cidstrcount > 0) {
        echo('<a href="?do=str&cid=' . $cid . '" class="actionBtn" style="margin-left:10px"><em>设置</em></a>');
    }
}
if ((!isset($csetting['listnoadd']) || $csetting['listnoadd'] == 0) && power('s', $cid, $power, 1) && $tablecreated) {
    echo('<a href="?do=list_add&cid=' . $cid . $articletableuri . $articleschooseuri . $moudleiduri . '" class="actionBtn add"><em>增加</em></a>');
}
?>
    <a href="?do=list&cid=<?php echo($cid); ?>"><?php echo($cname); ?></a>
<?php
$where['searchcolumn'] = getlistsearchcolumn($cid);
if (count($where['searchcolumn']) > 1) {
    ?>
    <div class="searcharea">
        <form name="filter" action="?do=list" method="GET">
            <input type="hidden" name="do" value="list">
            <?php
            if (!empty($articletable)) {
                echo('<input type="hidden" name="articletable" value="' . $articletable . '">');
            }
            if (isset($articlechoose)) {
                echo('<input type="hidden" name="articlechoose" value="' . $articlechoose . '">');
            }
            if (isset($articleschoose)) {
                echo('<input type="hidden" name="articleschoose" value="' . $articleschoose . '">');
            }
            if (isset($allarticleschoose)) {
                echo('<input type="hidden" name="allarticleschoose" value="' . $allarticleschoose . '">');
            }
            if (isset($articlemname)) {
                echo('<input type="hidden" name="articlemname" value="' . $articlemname . '">');
            }
            ?>
            <input type="hidden" name="cid" value="<?php echo($cid); ?>">
            <input type="text" class="inputtext" style="width:180px" name="keyword"
                   value="<?php if ($keyword <> '') {
                       echo(trim(htmlspecialchars($_GET['keyword'])));
                   } ?>" placeholder="">
            <?php
            getHooks()->do_action('admin_listsearch');
            ?>
            <input class="btn btn-xs btnsearch" type="submit" value="搜索"/>
        </form>
    </div>
    <?php
}
?>